<template>
    <div>
        <div class="headbox" :class="{bgc:bgcolor}">
            <!-- 返回上一个页面  箭头 -->
            <div class="goback">
                <img src="https://cdn7.axureshop.com/demo/1182587/images/%E7%99%BB%E5%BD%95/shape_u112.png" alt=""
                    @click="goback" />
                    <span>{{ title }}</span>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: 'BackHeader',
    props:["title","bgcolor"],

    data() {
        return {
            
        };
    },

    mounted() {
        
    },

    methods: {
        // 返回上一个页面
        goback() {
            this.$router.go(-1);
        }
    },
};
</script>

<style lang="less" scoped>
.headbox {
    width: 100%;
    height: 5rem;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #fff;
    z-index: 99;

    .goback {
        width: 100%;
        position: absolute;
        bottom: 0;
        height: 4.4rem;
        line-height: 4.4rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.8rem;
        font-weight: bold;
        cursor: pointer;
        img {
            width: 1rem;
            height: 1.8rem;
            position: absolute;
            left: 2rem;
        }
    }
}
.bgc{
    background-color: #FFDBAD;
}
</style>